//
//  ViewController.swift
//  LXReuseTools
//
//  Created by lxpray@163.com on 08/02/2021.
//  Copyright (c) 2021 lxpray@163.com. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    let json = [
//                    "id": 1234,
                    "title": "text",
                    "content": "hahahahahah",
                    "commentEnabled": 1
    ] as [String : Any]
//        var lock_t: pthread_rwlock_t = pthread_rwlock_t()
//        pthread_rwlock_init(&lock_t, nil)
//        pthread_rwlock_rdlock(&lock_t)
        do {
            let data = try JSONSerialization.data(withJSONObject: json, options: .fragmentsAllowed)
            print(data)
            let model: XXTestModel = try JSONDecoder().decode(XXTestModel.self, from: data)
            print(model.id)

        } catch let err {
            print(err)

        }
    }
    
    
    @IBAction func btnAction(_ sender: Any) {
//        XXHudManager .showMessage(msg: "按钮被点击", to: self.view)
        XXHudManager.showLoading()
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}

